﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 多态
{
    public class peosonrr
    {
        private string _name;
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        public peosonrr(string name)
        {
            this.Name = name;
        }
        //virtual virtual virtual virtual virtual virtual virtual virtual virtual virtual virtual
        public virtual void SayHello()
        {
            Console.WriteLine("我是人类");
        }
    }

    public class Chinese : peosonrr
    {
        public Chinese(string name)
            : base(name)
        {

        }
        public override void SayHello()
        {
            Console.WriteLine("我是中国人，我叫{0}",this.Name);
        }
    }

    public class Japanese : peosonrr
    {
        public Japanese(string name)
            : base(name)
        {

        }
        public override void SayHello()
        {
            Console.WriteLine("我是脚盆人，我叫{0}",this.Name);
        }
    }

    public class Korea : peosonrr
    {
        public Korea(string name)
            : base(name)
        {

        }
        public override void SayHello()
        {
            Console.WriteLine("我是棒子国，我叫{0}",this.Name);
        }
    }

    public class American : peosonrr
    {
        public American(string name)
            : base(name)
        {

        }
        public override void SayHello()
        {
            Console.WriteLine("我是美国人，我叫{0}",this.Name);
        }
    }

    public class Zhen
    {
        public virtual void baye()
        {
            Console.WriteLine("真鸭子嘎嘎叫");
        }
    }
    public  class Mu:Zhen
    {
        public override void baye()
        {
            Console.WriteLine("木头鸭子吱吱叫");
        }
    }
    public class Xiang : Zhen
    {
        public override void baye()
        {
            Console.WriteLine("橡皮鸭子吱吱叫");
        }
    }
}
